<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>学生成绩信息</title>
<script src="http://code.jquery.com/jquery-1.4.4.min.js"></script>

<style>
body {
	background-color: #97CBFF;
}
</style>
<script>
         $(function()
         {
        	 getStudent();
         })
         
          function getStudent(){
        	 
        	 $.ajax({
        		 url: "/allscore",
        		 type: "post",
                
        	     success: function(abc){
        	    	 $.each(abc,function(i,fl){
        	    		 var sid = fl.sno;//注意要与实体类中的名称相同
                         var name = fl.sname;
        	             var major=fl.smajor;
        	             var grade=fl.sgrade;
                         var cid= fl.cno;
                         var name2 = fl.cname;
                         var sscore = fl.score;

                         var value = "<tr><td align='center'>"+sid+"</td>";
                          value +="<td align='center'>"+name+"</td><td align='center'>"+major+"</td> <td align='center'>"+grade+"</td><td align='center'>"+cid+"</td> <td align='center'>"+name2+"</td><td align='center'>"+sscore+"</td><tr/>";
                           
                         
                         $("#tb").append(value);//写入到id为tb的htmln部分
  	                  });
        	     }
        	 })  
         }
            
         
       </script>

</head>
<body>
	<table id="tb" width="80%" border="1" cellspacing="0" cellpadding="0"
		align="center">
		<tr>

			<th align="center">学号</th>
			<th align="center">姓名</th>
			<th align="center">专业</th>
			<th align="center">年级</th>
			<th align="center">课程号</th>
			<th align="center">课程名</th>
			<th align="center">成绩</th>
			

		</tr>
	</table>
	<input type="button" value="返回"  style="width: 100px; height: 50px;" onclick="location.href='teacher.html'"/>
</body>
</html>